import { LANG } from '@/constant'
import { getItem, setItem } from '@/utils/storage'
const state = {
  sidebarOpened: true,
  language: getItem(LANG) || 'zh'
}

const mutations = {
  triggerSidebarOpened(state) {
    state.sidebarOpened = !state.sidebarOpened
  },
  changeLanguage(state, language) {
    state.language = language
    setItem(LANG, language)
  }

}

const actions = {

}

export default {
  namespaced: true,
  state,
  mutations,
  actions
}
